<?php

class RobotServiceEx extends \SoapClient {
  
  /**
   *
   * @var array $classmap The defined classes
   */
  private static $classmap = array(
    'openSession' => '\\openSession',
    'RobotRequest' => '\\RobotRequest',
    'UserAttribute' => '\\UserAttribute',
    'openSessionResponse' => '\\openSessionResponse',
    'RobotResponse' => '\\RobotResponse',
    'RobotCommand' => '\\RobotCommand',
    'closeSession' => '\\closeSession',
    'closeSessionResponse' => '\\closeSessionResponse',
    'deliver' => '\\deliver',
    'deliverResponse' => '\\deliverResponse'
  );

  /**
   *
   * @param array $options
   *          A array of config values
   * @param string $wsdl
   *          The wsdl file to use
   */
  public function __construct(array $options = array(), $wsdl = null) {
    foreach (self::$classmap as $key => $value) {
      if (! isset($options['classmap'][$key])) {
        $options['classmap'][$key] = $value;
      }
    }
    $options = array_merge(array(
      'features' => 1
    ), $options);
    if (! $wsdl) {
      $wsdl = 'http://ibotcluster.online.uairobot.com/robot/app/bjhg/ws/RobotServiceEx?wsdl';
    }
    parent::__construct($wsdl, $options);
  }

  /**
   *
   * @param openSession $parameters          
   * @return openSessionResponse
   */
  public function openSession(openSession $parameters) {
    return $this->__soapCall('openSession', array(
      $parameters
    ));
  }

  /**
   *
   * @param closeSession $parameters          
   * @return closeSessionResponse
   */
  public function closeSession(closeSession $parameters) {
    return $this->__soapCall('closeSession', array(
      $parameters
    ));
  }

  /**
   *
   * @param deliver $parameters          
   * @return deliverResponse
   */
  public function deliver(deliver $parameters) {
    return $this->__soapCall('deliver', array(
      $parameters
    ));
  }
}
